package com.authine.cloudpivot.web.api.quartz.task;

import com.alibaba.dubbo.config.annotation.Reference;
import com.authine.cloudpivot.engine.api.facade.TaskReportFacade;
import com.authine.cloudpivot.web.api.service.TimingTaskService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ArchiveReportJob implements Job  {
    @Reference(version = "1.00")
    private TaskReportFacade taskReportFacade;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        log.info("自动将周报状态设置成已归档------------------------------------");
        JobDataMap jobDataMap = context.getMergedJobDataMap();
        String type =  jobDataMap.get("data1").toString();
        taskReportFacade.autoArchiveReport(type);
        log.info("自动将周报状态设置成已归档------------------------------------");
    }
}
